Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vector assignment with undefined delay #1164

Merged
merged 2 commits into from
Sep 7, 2024

Conversation

larsclausen
Copy link
Collaborator

Assignments with an undefined delay should be treated like assignments with
zero delay. For the most part this is implemented correctly, except for
assignments to a part of a vector where the offset inside the vector is an
immediate value. E.g.

reg [1:0] x;
integer d = 'x;
...
x[0] <= #d 1'b1

Here when loading the delay into the index register flag 4 is updated, but
never cleared afterwards. As a result, if the delay is undefined, the vector
assignment will be skipped. Fix this by making sure flag 4 is always
cleared before the vector assignment instruction.

Assignments with an undefined intra-assignment delay should be treated like
assignments with zero delay. For the most part this is implemented
correctly, except for assignments to a part of a vector where the offset
inside the vector is an immediate value. E.g.
```
reg [1:0] x;
integer d = 'x;
...
x[0] <= #d 1'b1
```

Here when loading the delay into the index register flag 4 is updated, but
never cleared afterwards. As a result, if the delay is undefined, the vector
assignment will be skipped. Fix this by making sure flag 4 is always
cleared before the vector assignment instruction.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Check that assignments with undefined intra-assignment delay get executed
with zero delay. The assignment should not be skipped.

Signed-off-by: Lars-Peter Clausen <[email protected]>
@martinwhitaker martinwhitaker merged commit 07d5c6f into steveicarus:master Sep 7, 2024
5 checks passed
@larsclausen larsclausen deleted the fix-undefined-delay branch September 8, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants